<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue v-pre 指令</title>
</head>

<body>
    <!--快捷输入 div#app.app<tab> -->
    <div id="app" class="app">
        <div v-pre >{{ info }} </div>
        <div v-pre  v-text="info"></div>
        <div v-pre>{{ info }} </div>
    </div>
    <script type="module">
        import { createApp, ref } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.js'

        let app = createApp({
            setup() {
                let info = ref("Hello, Vue")

                setInterval(
                    () => {
                        info.value = info.value + "!"
                        console.log(info);

                    },
                    1000
                )

                return {
                    info,
                }
            }
        })

        // 挂载——将 Javascript 代码和 html 通过 选择器 关联
        app.mount("#app")

    </script>
</body>

</html>